<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">
	function validateForm() {
		var nameproject = document.forms["form"]["nameproject"].value;
		var startdate = document.forms["form"]["startdate"].value;
		var enddate = document.forms["form"]["enddate"].value;
		var d1 = Date.parse(startdate);
		var d2 = Date.parse(enddate);
		if (nameproject == "") {
			alert("Nameproject khong duoc de trong");
			return false;
		}
		if (startdate == "") {
			alert("Startdate khong duoc de trong");
			return false;
		}
		if (enddate == "") {
			alert("Enddate khong duoc de trong");
			return false;
		}
		if (d1 > d2) {
			alert("Ngay bat dau lon hon ngay ket thuc");
			return false;
		}
	}
</script>
</head>
<body>
	<%@ include file="Menu.jsp"%>
	<div class="panel panel-default">
		<!-- Default panel contents -->
		<div class="panel-heading">Add new Project</div>
		<br>
		<form class="form-horizontal" action="doaddProject" method="post"
			name="form" onsubmit="return validateForm()">
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">Nameproject:</label>
				<div class="col-sm-10">
					<input type="text" name="nameproject" value="" />

				</div>
			</div>
			<div class="form-group">
				<label for="inputPassword3" class="col-sm-2 control-label">StartDate</label>
				<div class="col-sm-10">
					<input type="date" name="startdate" value="" />
				</div>
			</div>
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">EndDate:</label>
				<div class="col-sm-10">
					<input type="date" name="enddate" value="" />
				</div>
			</div>
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label"></label>
				<div class="col-sm-10">
					<input type="submit" name="add" value="Add" />
				</div>
			</div>
		</form>
	</div>
</body>
</html>